package cn.gz.ibix.load;

import java.util.HashMap;
import java.util.Map;

/**
 * 项目名称：QiYiChuAPP
 * <br>类描述：
 * <br>创建人：htliu
 * <br>创建时间：2018/3/24 20:10
 * <br>修改人:
 * <br>修改时间：2018/3/24 20:10
 * <br>修改备注：
 * <br>@version
 */
public class FoodLoaderManager {

    private Map<Long, FoodLoader> foodLoaderMap = new HashMap<>();

    private FoodLoaderManager() {

    }

    public static FoodLoaderManager getInstance() {
        return SingletonHolder.INSTANCE;
    }

    public FoodLoader get(long menuID) {
        FoodLoader loader = foodLoaderMap.get(menuID);
        if (loader == null) {
            loader = new FoodLoader(menuID);
            foodLoaderMap.put(menuID, loader);
        }
        return loader;
    }

    private static class SingletonHolder {
        private static final FoodLoaderManager INSTANCE = new FoodLoaderManager();
    }
}
